home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 2
/
Merciful - Disc 2.iso
/
software
/
d
/
devioustools21.dms
/
devioustools21.adf
/
utils
/
002.lzx
/
rexx
/
finger.AMIRX
< prev
Wrap
Text File
|
1978-01-22
|
3KB
|
102 lines
/* finger.AMIRX -- AmiTCP finger script for AmIRC.
\\ Original idea and script by: Alexander "Handtuch" Sorg
// Edited/updated/overhauled by: Troy "Doogie" Davis (doogie@wsp1.wspice.com)
\\ $VER: finger.AMIRX v1.2 (12.21.95)
//
\\ AmiTCP:bin/finger must exist for this script to work.
// Put this script in PROGDIR:rexx/ and add it as an alias with the command:
\\ "/alias finger /rx finger %p"
//
\\ History
//
\\ v1.0 (12.17.95)
// · First attempt. (Fixed a few things in Alexander's original version.)
\\
// v1.1 (12.19.95)
\\ · Added -w switch.
// · Fixed a serious problem that would cause temp files to accumulate in
\\ T:
//
\\ v1.2 (12.21.95)
// · If userhost is not found in AmIRC's internal list of userhosts, the
\\ script will perform a "userhost" command and wait three seconds for
// one to be returned.
\\ · Added -v switch.
// · Added the way cool version string and history.
\\
// Usage: FINGER [-v] [-w] nick
\\
// The -v switch returns version information.
\\ The -w switch redirects output to a CON: window instead of to AmIRC.
*/
parse arg args
options results
if ~show('L','rexxsupport.library') then addlib('rexxsupport.library',0,-30,0)
if find(args,'-v') ~=0 then do
"ECHO P="d2c(27)"b«Version»"d2c(27)"b finger.AMIRX v1.2 (12.21.95) by Troy ""Doogie"" Davis (doogie@wsp1.wspice.com)."
exit
end
if args = "" | args = "-w" then do
"echo P="d2c(27)"b«Error»"d2c(27)"b Usage: FINGER [-v] [-w] nick"
exit
end
if find(args,'-w') ~= 0 then do
pos = find(args,'-w')
nick = delword(args,pos,1)
nick = trim(nick)
win = "yes"
end
else do
win = "no"
nick = trim(args)
end
userhost nick
nickhost = result
if nickhost = "RESULT" then do
"raw userhost :"nick
delay(150)
userhost nick
nickhost = result
if nickhost = "RESULT" then do
"echo P="d2c(27)"b«Error»"d2c(27)"b Could not obtain userhost for the nick """nick""". Finger failed."
exit
end
end
"echo P="d2c(27)"b«Finger»"d2c(27)"b Launching finger on "d2c(2)nick d2c(2)"("nickhost")."
namevalid = 0
count = 1
do while namevalid = 0
filename = "T:FingTemp"||count
if exists(filename) then do
count = count + 1
end
else do
namevalid = 1
end
end
address command 'AmiTCP:bin/Finger >' filename nickhost
if win = "no" then do
call open(1,filename,r)
do until eof(1)
text=readln(1)
'echo P='d2c(27)'b«Finger»'d2c(27)'b "'text '"'
end
call close(1)
end
else do
address command 'type >"CON:0/0/640/250/Finger info for: 'nick' ('nickhost')/WAIT/CLOSE"' filename
end
"echo P="d2c(27)"b«Finger»"d2c(27)"b End of FINGER output."
delete(filename)